package rocky.freemanagementsystemserver.repository;

import org.springframework.data.jpa.repository.JpaRepository
import org.springframework.data.jpa.repository.Query
import rocky.freemanagementsystemserver.Entity.User
import rocky.freemanagementsystemserver.projection.UserInfo

interface UserRepository : JpaRepository<User, String> {


    @Query("select (count(u) > 0) from User u where upper(u.createBy.name) = upper(?1) and u.createBy.password = ?2")
    fun existUserByPassword(name: String, password: String): Boolean


    fun findByNameEqualsIgnoreCase(name: String): User

}